/*
 * Copyright (C), 2013-2017, 汇通达网络有限公司
 * FileName: SpringContextUtil.java
 * Author:   杨振宁
 * Date:     2017-2-21 下午7:57:12
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.htd.apm.job;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


@Component("jobSpringContextUtil")
public class SpringContextUtil implements ApplicationContextAware{

    private static ApplicationContext context;

    public static ApplicationContext getApplicationContext() {
        return context;
    }

    public void setApplicationContext(ApplicationContext ctx) throws BeansException {
        context = ctx;

    }

    public static Object getBean(String beanName) {
        return context.getBean(beanName);
    }


}
